import 'dart:core';
import 'package:hive/hive.dart';

part 'dsItem.g.dart';

// RUN: flutter packages pub run build_runner build
@HiveType(typeId: 11)
class DSItem {
  @HiveField(0)
  String host;
  @HiveField(1)
  int port;
  @HiveField(2)
  String user;
  @HiveField(3)
  String pwd;
  @HiveField(4)
  String db;

  DSItem({this.host, this.port, this.user, this.pwd, this.db});

  DSItem.fromMap(Map<String, dynamic> json)
      : host = json['host'],
        port = json['port'],
        user = json['user'],
        pwd = json['pwd'],
        db = json['db'];

  Map<String, dynamic> toMap() =>
      {'host': host, 'port': port, 'user': user, 'pwd': pwd, 'db': db};
}
